package com.alcohol.lab.temp.ctl;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import liquor.util.BigDecimalUtil;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.alcohol.lab.temp.svc.SampleSVC;
import com.alcohol.lab.temp.vo.MembersVO;

@Controller
public class SampleCtl {
	
	@Resource(name="sampleSVC")
	private SampleSVC service;
	
	@RequestMapping("sample.do")
	public ModelAndView home(HttpServletRequest request, HttpServletResponse response) throws Exception {
		ModelAndView mav = new ModelAndView("sample/sample");
		
		String id = request.getParameter("id");
		MembersVO membersVO = new MembersVO();
		membersVO.setId(id);
		membersVO = (MembersVO)service.getMember(membersVO);
		if( membersVO != null ) mav.addObject("membersVO", membersVO);
		BigDecimalUtil.equals(null, null);
		mav.addObject("sampleMessage", "Asahi MatNaDa!!");
		return mav;
	}
}
